﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Windvoice.Blog
{
    [ActiveRecord("Article")]
    public partial class Article : ActiveRecordBase<Article>
    {
        [PrimaryKey(PrimaryKeyType.Identity, "ID")]
        public int ID
        {
            get;
            set;
        }

        [Display(Name="标题")]
        [Required]
        [Property]
        public string Title
        {
            get;
            set;
        }

        [Display(Name = "唯一标识")]
        [Required]
        [Property]
        public string UniqueKey
        {
            get;
            set;
        }

        [Display(Name = "分类")]
        [Required]
        [Property]
        public int CategoryID
        {
            get;
            set;
        }

        [Display(Name = "作者")]
        [Required]
        [Property]
        public string Author
        {
            get;
            set;
        }

        [Display(Name = "天气")]
        [Required]
        [Property]
        public int Weather
        {
            get;
            set;
        }

        [Display(Name = "内容")]
        [Required]
        [Property]
        [AllowHtml]
        public string Content
        {
            get;
            set;
        }

        [Property]
        public int Hits
        {
            get;
            set;
        }

        [Property]
        [Required]
        public DateTime CreateTime
        {
            get;
            set;
        }
    }

    public enum WindvoiceWeatherCondition
    {
        Sunny=1,
        Rainy=2,
        Cloudy=3,
        Overcast=4,
        Snowy=5,
        Shower=6
    }
}